]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-screenshot: Fix cursor fetching for non single window screenshots
authorAdel Gadllah <adel.gadllah@gmail.com>
Sun, 10 Feb 2013 13:18:54 +0000 (14:18 +0100)
committerAdel Gadllah <adel.gadllah@gmail.com>
Mon, 11 Feb 2013 18:53:54 +0000 (19:53 +0100)
We have to mark the cairo_surface dirty after modifying the data behind
cairo's back.

Also use CAIRO_FORMAT_ARGB32 rather then CAIRO_FORMAT_RGB24 for the
surface to be consistent with the rest of the code.

https://bugzilla.gnome.org/show_bug.cgi?id=691715

src/shell-screenshot.c

index 2914e07054cb1e9c11eb6c070437c036ba6a00ca..da75ce09c9cc49c883b2ba6d19382cdf9528e4c8 100644 (file)
@@ -217,7 +217,7 @@ do_grab_screenshot (_screenshot_data *screenshot_data,
   backend = clutter_get_default_backend ();
   context = clutter_backend_get_cogl_context (backend);
 
-  screenshot_data->image = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
+  screenshot_data->image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
                                                        width, height);
 
 
@@ -234,6 +234,8 @@ do_grab_screenshot (_screenshot_data *screenshot_data,
                                             x, y,
                                             COGL_READ_PIXELS_COLOR_BUFFER,
                                             bitmap);
+
+  cairo_surface_mark_dirty (screenshot_data->image);
   cogl_object_unref (bitmap);
 }